package test.study.java.jol.samples;

import lombok.extern.slf4j.Slf4j;
import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

//https://github.com/openjdk/jol/tree/master/jol-samples/src/main/java/org/openjdk/jol/samples
@Slf4j
public class JOLSample_01_Basic {

    /*
     * This sample showcases the basic field layout.
     * You can see a few notable things here:
     *   a) how much the _3_object header consumes;
     *   b) how fields are laid out;
     *   c) how the external alignment beefs up the _3_object size
     */
    public static void main(String[] args) {
        log.info(VM.current().details());
        log.info(ClassLayout.parseClass(A.class).toPrintable());
    }

    public static class A {
        boolean f;
    }
}
